import { Transform } from 'class-transformer';
import { IsEnum, IsOptional } from 'class-validator';
import { PagingDto } from 'src/common/dto';
import { CarbillStatusEnum } from 'src/common/enum';

export class ListCarbillDto extends PagingDto {
  @IsOptional()
  @Transform(({ value }) => {
    return (value?.split(',') || []).map((item) => CarbillStatusEnum[item]);
  })
  @IsEnum(CarbillStatusEnum, { each: true })
  carbillStatus: CarbillStatusEnum[];
}
